package com.bobamrz.domain;

// Generated 01.06.2013 15:30:51 by Hibernate Tools 4.0.0

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * DocumentDocCatalog generated by hbm2java
 */
@Entity
@Table(name = "document_doc_catalog", schema = "public")
public class DocumentDocCatalog implements java.io.Serializable {

	private long documentDocCatalog;
	private Document document;
	private DocCatalog docCatalog;
	private Date catalogTime;

	public DocumentDocCatalog() {
	}

	public DocumentDocCatalog(long documentDocCatalog) {
		this.documentDocCatalog = documentDocCatalog;
	}

	public DocumentDocCatalog(long documentDocCatalog, Document document,
			DocCatalog docCatalog, Date catalogTime) {
		this.documentDocCatalog = documentDocCatalog;
		this.document = document;
		this.docCatalog = docCatalog;
		this.catalogTime = catalogTime;
	}

	@Id
	@SequenceGenerator(name = "seqGenerator2", sequenceName = "document_doc_catalog_id")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqGenerator2")
	@Column(name = "document_doc_catalog", unique = true, nullable = false, precision = 10, scale = 0)
	public long getDocumentDocCatalog() {
		return this.documentDocCatalog;
	}

	public void setDocumentDocCatalog(long documentDocCatalog) {
		this.documentDocCatalog = documentDocCatalog;
	}

	@ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
	@JoinColumn(name = "document_fk")
	public Document getDocument() {
		return this.document;
	}

	public void setDocument(Document document) {
		this.document = document;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "doc_catalog_fk")
	public DocCatalog getDocCatalog() {
		return this.docCatalog;
	}

	public void setDocCatalog(DocCatalog docCatalog) {
		this.docCatalog = docCatalog;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "catalog_time", length = 29)
	public Date getCatalogTime() {
		return this.catalogTime;
	}

	public void setCatalogTime(Date catalogTime) {
		this.catalogTime = catalogTime;
	}

}
